package com.ymatou.iapi.payment.testcase;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.payment.parameter.AcquireOrderBean;
import com.ymatou.iapi.payment.parameter.ChannelTypeEnum;
import com.ymatou.iapi.payment.parameter.PayTypeEnum;
import com.ymatou.iapi.payment.parameter.PaymentMessageDto;
import com.ymatou.iapi.payment.parameter.QueryBatchMessageBean;
import com.ymatou.iapi.payment.service.QueryBatchMessageCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.PayGateWayCallService;
import com.ymttest.database.sqlwapper.PayGateWayWapper;

/**
 * 支付报文批量查询 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_QueryBatchMessage {
	private static QueryBatchMessageBean querybatchmessageBean;
	private static QueryBatchMessageCall querybatchmessageCall;
	PayGateWayWapper pdw;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("支付报文批量查询");
	}

	@Before
	public void caseUp() {
		querybatchmessageBean = new QueryBatchMessageBean();
		querybatchmessageCall = new QueryBatchMessageCall();
		pdw = new PayGateWayWapper();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(querybatchmessageCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	private void verifyDB(QueryBatchMessageBean querybatchmessageBean2, ArrayList<PaymentMessageDto> result, ChannelTypeEnum channelTypeEnum) throws InterruptedException {
		Logger.debug("result:"+FormatUtil.beanToGSONString(result));
		List<PaymentMessageDto> dblist = pdw.selectPaymentMessageDtoByPids(querybatchmessageBean2.getPaymentIdList());
		if(dblist==null||dblist.isEmpty()){
			Thread.sleep(2000);
			dblist = pdw.selectPaymentMessageDtoByPids(querybatchmessageBean2.getPaymentIdList());
		}
		Logger.debug(FormatUtil.beanToGSONString(dblist));
		for (PaymentMessageDto paymentMessageDto : result) {
			List<PaymentMessageDto> tempdbresult = dblist.stream().filter(r -> {
				return r.getPaymentId().equals(paymentMessageDto.getPaymentId());
			}).collect(Collectors.toList());
			// 收单返回报文
			String sqlreq = tempdbresult.stream().filter(r -> {
				return r.getLogType().equals("AcquireOrder");
			}).collect(Collectors.toList()).get(0).getResMessage();
			// 支付-第三方发送回来的报文
			String sqlresp = null;
			try {
				sqlresp = tempdbresult.stream().filter(r -> {
					return r.getLogType().equals("PaymentNotify");
				}).collect(Collectors.toList()).get(0).getReqMessage();
			} catch (Throwable e) {
				// TODO: handle exception
			}
			Logger.verifyEquals(tempdbresult.get(0).getActPayAmt().setScale(2), paymentMessageDto.getActPayAmt().setScale(2), "验证ActPayAmt");
			// 固定
			if (channelTypeEnum.equals(ChannelTypeEnum.AliPay)) {
				Logger.verifyEquals("ZFBZBW1", paymentMessageDto.getInstitutionPayCode(), "验证InstitutionPayCode");
			} else if (channelTypeEnum.equals(ChannelTypeEnum.WeiXinPay)) {
				Logger.verifyEquals("CFTZFKJ", paymentMessageDto.getInstitutionPayCode(), "验证InstitutionPayCode");
			} else {
				Logger.verifyEquals("", paymentMessageDto.getInstitutionPayCode(), "验证InstitutionPayCode");
			}
			
			Logger.verifyEquals(tempdbresult.get(0).getInstitutionPaymentId(), paymentMessageDto.getInstitutionPaymentId(), "验证InstitutionPaymentId");
			Logger.verifyEquals(tempdbresult.get(0).getPayStatus(), paymentMessageDto.getPayStatus(), "验证PayStatus");
			Logger.verifyEquals(tempdbresult.get(0).getPayType(), paymentMessageDto.getPayType(), "验证PayType");
			Logger.verifyEquals(sqlreq, paymentMessageDto.getReqMessage(), "验证ReqMessage");
			Logger.verifyEquals(sqlresp, paymentMessageDto.getResMessage(), "验证ResMessage");
			if (paymentMessageDto.getTradingTime() != null && !paymentMessageDto.getTradingTime().isEmpty()) {
				Logger.verifyEquals(tempdbresult.get(0).getTradingTime().substring(0, 19), paymentMessageDto.getTradingTime().replaceAll("T", " ").substring(0, 19),
						"验证TradingTime");
			}
		}

	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_001() {
		Logger.start(true, "10支付报文批量查询,成功");
		try {
			//tomcat共享站点可能出现root启动应用程序问题 导致权限异常
			//jetbrains.exodus.ExodusException: java.io.FileNotFoundException: /data/filedb/payment.iapi.ymatou.com/NORMAL/PaymentLog/00000003o00.xd (Permission denied)
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_QueryBatchMessage_002() {
		Logger.start(true, "11,13多个支付报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			Thread.sleep(1000);
			AcquireOrderBean aqb2 = PayGateWayCallService.initAcquireOrder("11");
			PayGateWayCallService.acquireOrder(aqb2);
			PayGateWayCallService.notifyCall(aqb2);
			Thread.sleep(1000);
			String pid2 = PayGateWayCallService.getPaymentId(aqb2);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			PaymentIdList.add(pid2);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			Thread.sleep(1000);
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_QueryBatchMessage_003() {
		Logger.start(true, "不输入PaymentId,失败");
		try {
			List<String> PaymentIdList = new ArrayList<>();
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("false", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			Logger.verifyEquals("1000", querybatchmessageCall.getString("ErrorCode"), "验证ErrorCode");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	@Ignore
	// 运行时间太长-本地执行验证
	public void Tc_QueryBatchMessage_004() {
		Logger.start(true, "输入PaymentId超过30个,失败");
		try {
			List<String> PaymentIdList = new ArrayList<>();
			for (int i = 0; i < 31; i++) {
				AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
				PayGateWayCallService.acquireOrder(aqb);
				String pid = PayGateWayCallService.getPaymentId(aqb);
				PaymentIdList.add(pid);
			}
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("false", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			Logger.verifyEquals("1000", querybatchmessageCall.getString("ErrorCode"), "验证ErrorCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_QueryBatchMessage_005() {
		Logger.start(true, "14,15微信多个支付报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			Thread.sleep(1000);
			AcquireOrderBean aqb2 = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb2);
			PayGateWayCallService.notifyCall(aqb2);
			Thread.sleep(1000);
			String pid2 = PayGateWayCallService.getPaymentId(aqb2);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			PaymentIdList.add(pid2);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			Thread.sleep(1000);
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_006() {
		Logger.start(true, "61applepay支付报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("61");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_007() {
		Logger.start(true, "62云闪付APP支付报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_008() {
		Logger.start(true, "64小米支付报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_009() {
		Logger.start(true, "10支付报文只收单-批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			Thread.sleep(3000);
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_010() {
		Logger.start(true, "65.HuaweiPay报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_011() {
		Logger.start(true, "66.SamSungPay报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_012() {
		Logger.start(true, "6000.HipoPayWxApp报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_013() {
		Logger.start(true, "6001HipoPayWxH5报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_014() {
		Logger.start(true, "6002HipoPayWxH5报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6002");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_015() {
		Logger.start(true, "6010盛付通微信小程序报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6010");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_016() {
		Logger.start(true, "6011盛付通微信公众号报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6010");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_017() {
		Logger.start(true, "6006代购神器HipoPayAliWap报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6006");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_018() {
		Logger.start(true, "6100GodAliPayPc报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6100");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_019() {
		Logger.start(true, "6103.HipoPay-微信app报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_020() {
		Logger.start(true, "6107.HipoPay-支付宝app报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6107");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_QueryBatchMessage_021() {
		Logger.start(true, "6003HipoPay报文批量查询,成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6003");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			List<String> PaymentIdList = new ArrayList<>();
			PaymentIdList.add(pid);
			querybatchmessageBean.setPaymentIdList(PaymentIdList);
			querybatchmessageCall.setData(querybatchmessageBean);
			querybatchmessageCall.callService();
			Logger.verifyEquals("true", querybatchmessageCall.getString("IsSuccess"), "验证IsSuccess");
			verifyDB(querybatchmessageBean, querybatchmessageCall.getResult(),PayTypeEnum.getChannelType(Integer.valueOf(aqb.getPayType())));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}